<template>
  <view class="pageBg">
    <custom-nav-bar title="我的"></custom-nav-bar>
    <view class="minecontainer">
      <view class="userInfo">
        <view class="avatar">
          <image src="../../static/image/avatar.png" mode="aspectFill"></image>
        </view>
        <view class="ip">{{ userstore.username }}</view>
        <view class="address">{{ userstore.phonenumber }}</view>
      </view>

      <wd-cell-group border>
        <wd-cell
          title="手机"
          :label="userstore.phonenumber"
          is-link
          to="/pages/phoneset/phoneset"
        />
        <wd-cell title="所属单位" :label="tenantname"></wd-cell>
      </wd-cell-group>
      <wd-cell-group border>
        <!-- 	<wd-cell title="协议" /> -->
        <wd-cell title="版本" label="1.0.7"></wd-cell>
      </wd-cell-group>
    </view>
  </view>
</template>

<script setup lang="ts">
import { GetTenant } from '@/API/user/index'
import { ref, onMounted } from 'vue'
import { useUserStore } from '@/store/user/index'
import { onShow } from '@dcloudio/uni-app'
const userstore = useUserStore()
const tenantname = ref('')
onMounted(async () => {
  const tenantinfo = await GetTenant()
  tenantname.value = tenantinfo.name!
})
onShow(() => {
  console.log('mine', 'App Show')
})
</script>

<style lang="scss" scoped>
:deep(.wd-cell__title) {
  font-size: 18px;
  // font-weight: bold;
}

//

.minecontainer {
  .userInfo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 50rpx 0;

    .avatar {
      width: 160rpx;
      height: 160rpx;
      border-radius: 50%;
      overflow: hidden;

      image {
        width: 100%;
        height: 100%;
      }
    }

    .ip {
      font-size: 44rpx;
      color: #333;
      padding: 20rpx 0 5rpx;
    }

    .address {
      font-size: 28rpx;
      color: #aaa;
    }
  }
}
</style>
